﻿#ifndef TOOLBARPROPERTY_H
#define TOOLBARPROPERTY_H

#include "MeasureView_global.h"
#include <QSettings>
#include <QToolBar>
class QSpinBox;
class QCheckBox;
class ColorComboBox;

namespace Qly {
class MeasureView;
class MEASUREVIEW_EXPORT ToolBarProperty : public QToolBar
{
        Q_OBJECT
public:
    ToolBarProperty(const QString &title, QWidget *parent = Q_NULLPTR);
    ToolBarProperty(QWidget *parent = Q_NULLPTR);
    void attach(MeasureView *widget);
    void loadSettings(QSettings &settings);
    void writeSettings(QSettings &settings);

private slots:
    void on_spinBoxLineWidthValueChanged(int v);
    void on_spinBoxTextSizeValueChanged(int v);
    void on_colorBoxColorChanged(Qt::GlobalColor c);
    void on_actionUndoTriggered();
    void on_actionDeleteAllTriggered();
private:
    void initContent();

private:
    QAction *actionUndo;
    QAction *actionDeleteAll;
    QSpinBox *spinBoxLineWidth;
    QSpinBox *spinBoxTextSize;
    ColorComboBox *colorBox;
    MeasureView *pMeasureView;
};

} //namespace Qly
#endif // TOOLBARPROPERTY_H
